package com.example.pkmedical.Activity.warning;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.pkmedical.Base.BaseActivity;
import com.example.pkmedical.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class WarningLeftTopActivity extends BaseActivity {

    @BindView(R.id.warning_left_top_text)
    TextView warningLeftTopText;
    @BindView(R.id.warning_left_center_text)
    TextView warningLeftCenterText;
    @BindView(R.id.headtile_back)
    RelativeLayout headtileBack;
    @BindView(R.id.warning_left_bottom_button)
    Button warningLeftBottomButton;
    @BindView(R.id.warning_left_top_background)
    RelativeLayout warningLeftTopBackground;
    @BindView(R.id.warning_left_image)
    ImageView warningLeftImage;
    @BindView(R.id.warning_left_image_arrow)
    ImageView warningLeftImageArrow;
    //0:绿色，1：白色
    private int mType = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_warninglefttop);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        Intent intent = getIntent();
        mType = intent.getIntExtra("colorType", 0);
        if (0 == mType) {
            greenBack();
        } else {
            whiteBack();
        }
    }

    @Override
    public void initPresenter() {

    }

    @Override
    public void showDialog(String... msg) {

    }

    @OnClick(R.id.warning_left_bottom_button)
    public void onViewClicked() {
        finish();
    }

    private void greenBack() {
        warningLeftCenterText.setText(R.string.foot_on);
        warningLeftTopBackground.setBackgroundResource(R.color.green_back);
        warningLeftImageArrow.setVisibility(View.GONE);
    }

    private void whiteBack() {
        warningLeftCenterText.setText(R.string.foot_up_dudu);
        warningLeftTopBackground.setBackgroundResource(R.color.white);
        warningLeftImage.setVisibility(View.GONE);
    }
}
